import _axios from 'src/axios/AxiosConfig'
import Vue from 'vue'

export function getAllUrl () {
  return _axios({
    url: Vue.prototype.$PUBLIC_PATH + 'api/loadAllUrl',
    method: 'get'
  })
}

export function getAllUrlTree () {
  return _axios({
    url: Vue.prototype.$PUBLIC_PATH + 'api/res/loadAllUrl',
    method: 'get'
  })
}

export function removeUrl (key) {
  return _axios({
    url: Vue.prototype.$PUBLIC_PATH + 'api/res/deleteUrl',
    method: 'delete',
    params: {
      id: key
    }
  })
}

export function updateUrl (data) {
  return _axios({
    url: Vue.prototype.$PUBLIC_PATH + 'api/res/updateUrl',
    method: 'put',
    data: data
  })
}

export function saveUrl (data) {
  return _axios({
    url: Vue.prototype.$PUBLIC_PATH + 'api/res/saveUrl',
    method: 'post',
    data: data
  })
}
